package com.s3.khospitalds.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.s3.khospitalds.entity.Prescription;
import com.s3.khospitalds.entity.PrintBill;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author: xw
 * @CreateTime: 2025/2/25
 * @Description: 患者药方表
 * @Version: 1.0
 */
@Mapper
@Repository
public interface PrescriptionMapper extends BaseMapper<Prescription> {
    @Select("SELECT * FROM prescription")
    List<Prescription> selectAll();
    @Select("SELECT * FROM prescription WHERE patientNumber = #{patientNumber}")
    List<Prescription> findPrescriptionByPatientNumber(String patientNumber);
    @Delete("DELETE FROM `prescription` WHERE patientNumber =#{number}")
    public int deletePrescriptionByNumber(String number);
}
